import {getInspectDetail} from "@/api/checkPage/checkApi";

const inspectMixins = {
  data() {
    return {
      inspectId: null,
      inspectInfo: null,
      handelCode: null
    }
  },
  methods: {
    initInspectInfo() {
      let {inspectId} = this
      let owner = this
      if (inspectId == null || inspectId === '') return;
      this.startLoading('正在加载....')
      getInspectDetail({id: inspectId}).then(res => {
        owner.inspectInfo = res.data
      }).finally(() => {
        owner.endLoading()
      });
    }
  },
  created() {
    this.inspectId = this.$route.query?.inspectId != null && this.$route.query?.inspectId !== '' ? this.$route.query.inspectId : null;
    this.handelCode = this.$route.query?.handelCode != null && this.$route.query?.handelCode !== '' ? this.$route.query.handelCode : null;
    this.initInspectInfo()
  }
}

export {inspectMixins}
